#ifndef POLYNOMIAL_H_
#define POLYNOMAL_H_

#include <Eigen/Eigen>
#include <iostream>

namespace Tube_planning
{
    // 计算分段多项式n(0,1,2,3...)阶导的类
    class Polynomial
    {
    private:
        Eigen::MatrixXd Poly_mat;
        Eigen::ArrayXd tt;
        int n_segment, n_order, n_coef;
        double start_time, end_time;
        int idx;

    public:
        Polynomial(){}
        Polynomial(const Eigen::MatrixXd &Polys, const Eigen::ArrayXd& ts);
        ~Polynomial();

        void setPolynomial(const Eigen::MatrixXd &Polys, const Eigen::ArrayXd& ts);
        double evaluatePolynomial(const double t, const int r);
        double poly_val(const double t, const int r);
        double getTotalTime();
        Eigen::ArrayXd evaluatePolynomialSequence(const  Eigen::ArrayXd& t_seq, const int r);
    };
    
}


#endif